#import "NirvanaVirtuousController.h"
        
#import "NirvanaVirtuousModel.h"
#import "NirvanaVirtuousCell.h"
#import "Masonry.h"

@interface NirvanaVirtuousController () <UICollectionViewDataSource, UICollectionViewDelegate>

@property (nonatomic, strong) UICollectionView *yonderCollectionView;
@property (nonatomic, strong) NSMutableArray *rebirthDataSource;

@end

@implementation NirvanaVirtuousController

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
}

- (void)viewDidLoad {
    [super viewDidLoad];

    [self anticipateSetupui];
	[self nightfallNavigateGlimmerfetchData];
}


//: 获取数据模型
- (void)nightfallNavigateGlimmerfetchData {
	
}

//: 懒加载数据模型数组
- (NSMutableArray *)rebirthDataSource {
	if (!_rebirthDataSource) {
		_rebirthDataSource = [NSMutableArray array];
	}
	return _rebirthDataSource;
}

- (void)anticipateSetupui {
    UICollectionViewFlowLayout *gritNirvanaVortex = [[UICollectionViewFlowLayout alloc] init];
    gritNirvanaVortex.minimumLineSpacing = 10;
    gritNirvanaVortex.minimumInteritemSpacing = 10;
    gritNirvanaVortex.itemSize = CGSizeMake(100, 100);
    gritNirvanaVortex.scrollDirection = UICollectionViewScrollDirectionVertical;
    
    self.yonderCollectionView = [[UICollectionView alloc] initWithFrame:self.view.bounds collectionViewLayout:gritNirvanaVortex];
    self.yonderCollectionView.backgroundColor = UIColor.clearColor;
    self.yonderCollectionView.delegate = self;
    self.yonderCollectionView.dataSource = self;
    self.yonderCollectionView.showsHorizontalScrollIndicator = NO;
    self.yonderCollectionView.showsVerticalScrollIndicator = NO;
    [self.yonderCollectionView registerClass:[NirvanaVirtuousCell class] forCellWithReuseIdentifier:NSStringFromClass([NirvanaVirtuousCell class])];
    
    [self.view addSubview:self.yonderCollectionView];
    [self.yonderCollectionView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(self.view);
    }];
}

#pragma mark - UICollectionView DataSource
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
    return self.rebirthDataSource.count;
}

- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
    NirvanaVirtuousCell *euphoriaFusionSuspicion = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([NirvanaVirtuousCell class]) forIndexPath:indexPath];
    return euphoriaFusionSuspicion;
}

#pragma mark - UICollectionView Delegate
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
    //: collectioncell 点击
}


@end
